<template>
	<view>
		<cu-custom :bgColor="globalColor" :isBack="false">
		    <block slot="content">其他工具</block>
		</cu-custom>
		<view >
			<view class="codeWrap padding-sm" @click="toPage(1)">
			       <image mode="scaleToFill" class="codeImg" src="/static/img/md5-1.png" alt="">
			       <view class="codeWord">
			           <p class="keyWord">视频MD5值修改</p>
			           <p>可以有效解决视频的唯一性，防重检测</p>
			       </view>	
		   </view>
		<view class="codeWrap padding-sm" @click="toPage(2)">
				   <image mode="scaleToFill" class="codeImg" src="/static/img/imageToTeXT.png" alt="">
				   <view class="codeWord">
					   <p class="keyWord">图片去水印</p>
					   <p>轻松去掉本地图片水印</p>
				   </view>	
		   </view>
		   <view class="codeWrap padding-sm" @click="toPage(3)">
				   <image mode="scaleToFill" class="codeImg" src="/static/img/batch.png" alt="">
				   <view class="codeWord">
					   <p class="keyWord">背景音乐提取</p>
					   <p>轻松提取视频的背景音乐，通用的MP3格式，非常方便</p>
				   </view>	
		   </view>
		   <view class="codeWrap padding-sm" @click="toPage(8)">
			   <image mode="scaleToFill" class="codeImg" src="/static/img/music-3.png" alt="">
			   <view class="codeWord">
				   <p class="keyWord">去除背景音乐</p>
				   <p>轻松提取视频的背景音乐，通用的MP3格式，非常方便</p>
			   </view>	
		   </view>
		   </view>
		   <ad v-if="showAd" :unit-id="ad" ad-type="video" ad-theme="white"></ad>
		</view>
	</view>
</template>

<script>	
	export default {
	    data() {
	        return {
	            tempFilePath: '',
	            cropFilePath: '',
				showAd:false,
				ad:'',
				globalColor: getApp().globalData.globalColor
	        }
	    },
		onLoad() {
			this.ad = getApp().globalData.toolAd
			console.log(getApp().globalData.toolAd)
			this.showAd = true
			
		},
		onShareAppMessage(res) {
			return {
			  title: '抖音、快手、皮皮虾短视频一键去水印,去水印还能这么简单,图片也可以去水印哟',
			  path: '/pages/index/index',
			  imageUrl: 'http://parse-video-server.oss-cn-hangzhou.aliyuncs.com/share.png'
			}
		},
		onShareTimeline: () => {
		  return {
		    title: getApp().globalData.shareTitle,
		    query: "/pages/index/index",
		    imageUrl:getApp().globalData.sharePic
		  }
		},
	    methods: {
			toPage(index) {
				console.log(index)
				if(index == 1) {
					uni.navigateTo({
						url:'../md5/md5'
					})
				}else if(index == 2) {
					uni.navigateTo({
						url:'../cropper/cropper'
					})
				}else if(index == 3) {
					uni.navigateTo({
						url:'../music/music'
					})
				}else if(index == 4) {
					uni.navigateTo({
						url:'../fontToVoice/fontToVoice'
					})
				}else if(index == 5) {
					uni.navigateTo({
						url:'../imgageToText/imgageToText'
					})
				}else if(index == 6) {
					uni.navigateTo({
						url:'../easyCode/easyCode'
					})
				}else if(index == 7) {
					var that = this;
					uni.previewImage({
						urls: [getApp().globalData.shareImg],
						longPressActions: {
							itemList: ['发送给朋友', '保存图片', '收藏']
						}
					});
				}else if(index == 8) {
					uni.navigateTo({
						url:'../clearMusic/clearMusic'
					})
				}
			}
	    }
	}
</script>

<style>
	.codeWrap{
		display:flex;
		justify-content: space-between;
		width:100%;
		background: white;
		border-radius: 16upx;
		margin-top: 8upx;

	}
	.codeImg{
		width:100upx;
		height: 100upx;
	}
	.codeWord{
		width:100%;
		align-items: center;
		padding:0 40upx;
		box-sizing: border-box;
		
	}
	
	.keyWord {
		color: blue;
		font-size: 16px;
	}
</style>
